package com.globant.google.mendoza.malbec;

public class BuyerGiftCertificate implements BuyerInformation {

  /** The gift certificate code to send.
   */
  private String giftCertificateCode;

  /** Creates the data that the buyer posts when adding gift certificates before
   *  placing an order.*/
  public BuyerGiftCertificate(final String theGiftCertificateCode) {

    if (theGiftCertificateCode == null) {
      throw new IllegalArgumentException(
          "the gift certificate code cannot be null");
    }
    giftCertificateCode = theGiftCertificateCode;
  }

  public String getGiftCertificateCode() {
    return giftCertificateCode;
  }

  public void execute(BuyerVisitor visitor) {
    visitor.enterGiftCertificate(this);
  }
}
